/*    */ package com.cr.framework.shiro.web.filter.sync;
/*    */ 
/*    */ import com.cr.framework.shiro.session.OnlineSession;
/*    */ import com.cr.framework.shiro.session.OnlineSessionDAO;
/*    */ import javax.servlet.ServletRequest;
/*    */ import javax.servlet.ServletResponse;
/*    */ import org.apache.shiro.web.filter.PathMatchingFilter;
/*    */ 
/*    */ public class SyncOnlineSessionFilter extends PathMatchingFilter {
/*    */   private OnlineSessionDAO onlineSessionDAO;
/*    */   
/*    */   protected boolean onPreHandle(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception {
/* 25 */     OnlineSession session = (OnlineSession)request.getAttribute("online_session");
/* 28 */     if (session != null && session.getUserId() != null && session.getStopTimestamp() == null)
/* 30 */       this.onlineSessionDAO.syncToDb(session); 
/* 32 */     return true;
/*    */   }
/*    */   
/*    */   public void setOnlineSessionDAO(OnlineSessionDAO onlineSessionDAO) {
/* 37 */     this.onlineSessionDAO = onlineSessionDAO;
/*    */   }
/*    */ }


/* Location:              D:\tmp\creditorRights-admin\BOOT-INF\lib\creditorRights-framework-4.7.0.jar!\com\cr\framework\shiro\web\filter\sync\SyncOnlineSessionFilter.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */